.quarkdown {
  text-align: var(--qd-horizontal-alignment-global);

  // Local alignment (e.g. justification) is applied to specific elements instead of the whole document (#123).
  p:not(.page-margin-content p, .mermaid p),
  li:not(nav li) {
    text-align: var(--qd-horizontal-alignment-local);
    text-align-last: var(--qd-horizontal-alignment-global, start);
  }

  caption, figcaption {
    text-align: var(--qd-horizontal-alignment-local);
    text-align-last: center;
  }

  // #263
  formula {
    text-align: initial;
    text-align-last: initial;
  }
}

.quarkdown-slides {
  --qd-horizontal-alignment-global: center;

  .reveal .slides > :is(section, .pdf-page) {
    text-align: var(--qd-horizontal-alignment-global);
  }

  .speaker-notes {
    --qd-horizontal-alignment-global: start;
    --qd-horizontal-alignment-local: start;
  }
}

.quarkdown-plain, .quarkdown-paged {
  --qd-horizontal-alignment-local: justify;
}